"""
3 编写一个程序，读取文件中保存的10个学生成绩名单信息(学号,姓名, Python课程分数);
然后按照分数从高到低进行排序输出
"""

with open('3.txt', mode='r', encoding='utf-8') as f:
    data = f.read().strip().split('\n')

# print(data)
student = []
for i in data:
    temp = i.split(',')
    temp[2] = int(temp[2])
    student.append(temp)

# print(student)

student.sort(key=lambda x:x[2])
# print(student)
for i in student:
    print(i)

